home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / Apps / MOO-1.7.6.src / inc / storage.h < prev    next >
Text File  |  1994-11-02  |  3KB  |  107 lines

  1. /******************************************************************************
  2.   Copyright (c) 1992 Xerox Corporation.  All rights reserved.
  3.   Portions of this code were written by Stephen White, aka ghond.
  4.   Use and copying of this software and preparation of derivative works based
  5.   upon this software are permitted.  Any distribution of this software or
  6.   derivative works must comply with all applicable United States export
  7.   control laws.  This software is made available AS IS, and Xerox Corporation
  8.   makes no warranty about the software, its performance or its conformity to
  9.   any specification.  Any person obtaining a copy of this software is requested
  10.   to send their name and post office or electronic mail address to:
  11.     Pavel Curtis
  12.     Xerox PARC
  13.     3333 Coyote Hill Rd.
  14.     Palo Alto, CA 94304
  15.     Pavel@Xerox.Com
  16.  *****************************************************************************/
  17.  
  18. #ifndef Storage_h
  19. #define Storage_h 1
  20.  
  21. #include "my-stdio.h"
  22.  
  23. #include "config.h"
  24. #include "structures.h"
  25.  
  26. /* get rid of this */
  27. extern Object **objects;
  28. extern int    nobjects;
  29.  
  30. typedef enum Memory_Type {
  31.     M_AST_POOL, M_AST, M_PROGRAM, M_PVAL, M_NETWORK, M_STRING, M_VERBDEF,
  32.     M_LIST, M_PREP, M_PROPDEF, M_OBJECT_TABLE, M_OBJECT,
  33.     M_STREAM, M_NAMES, M_ENV, M_PI, M_TASK,
  34.  
  35.     M_BYTECODES, M_FORK_VECTORS, M_LIT_LIST,
  36.     M_BYTECODE_LIST, M_BYTECODE_INFO, M_VL_VALUE, M_VL_LIST,
  37.     M_LITERALS, M_EXPR_STACK, M_COND_ARM_STACK, M_STMT_STACK,
  38.  
  39.     M_RT_STACK, M_RT_ENV, M_BI_FUNC_DATA, M_VM,
  40.  
  41.     M_REF_ENTRY, M_REF_TABLE,
  42.  
  43.     Sizeof_Memory_Type
  44.  
  45. } Memory_Type;
  46.  
  47. extern Var    players_list;
  48.  
  49. extern int    db_write(FILE *f);
  50. extern void    db_printf(const char *format, ...);
  51. extern int    db_read(FILE *f);
  52.  
  53. extern void    write_string(const char *);
  54. extern const char *read_string(FILE *);
  55. extern void    write_var(Var);
  56. extern Var    read_var(FILE *);
  57.  
  58. extern void    write_program(Program *);
  59. extern void    write_forked_program(Program *, unsigned f_index);
  60. extern int    read_program(FILE *, Program **);
  61.  
  62. extern int    is_wizard(Objid oid);
  63. extern int    is_programmer(Objid oid);
  64. extern int    is_player(Objid oid);
  65.  
  66. extern Object  *new_object(void);
  67. extern void     free_object(Objid);
  68.  
  69. extern Object  *retrieve(Objid);
  70. extern char       *str_dup(const char *);
  71. extern const char *str_ref(const char *);
  72. extern void        free_str(const char *);
  73. extern int    db_size(void);
  74. extern void    reset_db_size(void);
  75. extern Var    memory_usage(void);
  76.  
  77. extern void    myfree(void *where, Memory_Type type);
  78. extern void    *mymalloc(unsigned size, Memory_Type type);
  79.  
  80. #endif /* Storage_h */
  81.  
  82. /* $Log: storage.h,v $
  83.  * Revision 1.7  1992/10/23  23:03:47  pavel
  84.  * Added copyright notice.
  85.  *
  86.  * Revision 1.6  1992/10/21  03:02:35  pavel
  87.  * Converted to use new automatic configuration system.
  88.  *
  89.  * Revision 1.5  1992/10/17  20:53:28  pavel
  90.  * Global rename of strdup->str_dup, strref->str_ref, vardup->var_dup, and
  91.  * varref->var_ref, to avoid conflict on systems that provide their own
  92.  * definition of strdup().
  93.  *
  94.  * Revision 1.4  1992/09/14  17:39:30  pjames
  95.  * Moved db_modification code to db modules.
  96.  *
  97.  * Revision 1.3  1992/08/31  22:23:29  pjames
  98.  * Changed some `char *'s to `const char *'
  99.  *
  100.  * Revision 1.2  1992/08/28  16:25:17  pjames
  101.  * Added memory types for refcount module.  Added `strref()' and `free_str()'.
  102.  *
  103.  * Revision 1.1  1992/08/10  16:20:00  pjames
  104.  * Initial RCS-controlled version
  105.  *
  106.    */
  107.